*optimising your filter

the render routine uses dynamically generated code so the speed depends on the kernel.

 

*prefer zeroes to anything, anywhere.

*prefer 1s to any other number. this applies to all the entries except the bias.

*prefer powers of two to any other number except one. again this applies to all the entries except the bias.

*if your filter only uses two adjacent quardrants of the kernel (e.g. top left and top right), compare the speed of first applying whatever mirrors or rotations you need to instead enable to only use the bottom two quadrants, as if the only data entries are on or after the central value (reading across in rows like text) then it can use a slightly faster output routine.

*compare the speed of decomposing large 2d blurs into one horizontal one and one vertical one.

*if you only have positive data entries then have the wraparound flag on, as this may be slightly faster and will make no difference to the output.

*note: if the sum of all the positive entries is greater than 256 or the sum of all the negative ones is less than 256 then clipping may occur.

< previous :: contents :: next >